package com.atguigu.petstore.common.result;

import lombok.Getter;

/**
 * 统一返回结果状态信息类
 *
 */
@Getter
public enum ResultCodeEnum {

    SUCCESS(200,"成功"),
    FAIL(201, "失败"),

    //3xxx:  用户系统有关异常
    USER_CAPTCHA_INVAILD(30001,"验证码错误"),
    USER_ACCOUNT_PWD_ERROR(30002,"用户名密码错误"),
    USER_ID_REQUIRED(30003,"用户id必须携带"),
    USER_HAS_EXIST(30004,"用户已存在"),
    USER_INVAILD(30005,"非法用户，请重新登录"),
//    SHOP_PRODUCT_HAS_NO_STOCK(50001,"商品没有库存")


    //以后 APP 的错误都是 9xxxx
    APP_CODE_INVAILD(90001,"验证码错误"),
    APP_MEMBER_INVAILD(90002,"非法用户")
    ;

    private Integer code;

    private String message;

    private ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
